package com.sky.controller.user;

import com.sky.constant.RedisConstant;
import com.sky.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description UserShopController
 * @Author zhengyuan&junjun
 * @Date 2024-10-12
 */


@RestController("UserShopController")
@RequestMapping("/user/shop")
@ApiOperation("用户相关接口")

public class ShopController {
    @Autowired
    private RedisTemplate redisTemplate;


    @GetMapping("/status")
    @ApiOperation("获取店铺的营业状态")
    public Result<Integer> getshopstatus(){
        Integer status = (Integer) redisTemplate.opsForValue().get(RedisConstant.SHOP_STATUS_KEY);

        if (status == null){
            //初始化值
            status = 0;
        }
        return  Result.success(status);
    }



}
